import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import pandas as pd
import tushare as ts
from utils.confutils import ConfUtil

# 提取token
token = ConfUtil().get_tokens('tushare')
pro = ts.pro_api(token)
# 下载基本数据
df = pro.stock_basic(exchange='SSE,SZSE', list_status='L,D,P',fields='ts_code,symbol,name,area,market,exchange,industry,list_date,delist_date,list_status')
# 存到..\Data\RawData\stock_basic.feather文件中
tofile = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + "\\Data\\RawData\\stock_basic.feather"
df.to_feather(tofile)